package com.qn.meta.controlle;


import cn.dev33.satoken.annotation.SaCheckLogin;
import com.qn.common.base.BaseControlle;
import com.qn.common.base.model.RequestPage;
import com.qn.common.base.model.ResponseData;
import com.qn.common.base.model.ResponseMode;
import com.qn.meta.entity.FeatureBlacklist;
import com.qn.meta.service.FeatureBlacklistService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.*;

import java.util.List;
/**
 * qingniu-cloud user source analysis
 *
 * @Author: TXG
 * @Date: 2024/6/11
 * @Version V0.0.2
 */
@Tag(name = "元数据-黑名单")
@SaCheckLogin
@RestController
@RequestMapping("black/list")
public class FeatureBlacklistController extends BaseControlle {
    @DubboReference(version = "1.0.0")
    FeatureBlacklistService service;

    @Operation(summary ="分页查询")
    @PostMapping("page")
    public ResponseData<List<FeatureBlacklist>> getPage(@RequestBody RequestPage<FeatureBlacklist> rpage){
        return successD(service.getPage(rpage));
    }
    @Operation(summary ="保存信息")
    @PostMapping("save")
    public ResponseMode saves(@RequestBody FeatureBlacklist model) throws Exception {
        service.saves(model);
        return success();
    }
    @Operation(summary ="根据ID删除")
    @GetMapping("del/{id}")
    public ResponseMode delete(@PathVariable("id") @Parameter(name="ID")Integer id){
        service.del(id);
        return success();
    }
}